home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / matrixc.zip / MATRIX.H < prev    next >
C/C++ Source or Header  |  1989-11-19  |  694b  |  36 lines

  1. #ifndef defsmat
  2. #define defsmat 1
  3. /* Matrix structure */
  4. typedef struct
  5. {
  6.   int rows;
  7.   int cols;
  8.   double *block;
  9. } matrix,*matrixptr;
  10.  
  11. /*   E.G.
  12. double b4x4A[4][4]=
  13. {
  14.   6,1,6,6,
  15.   1,6,6,0,
  16.   0,3,2,1,
  17.   8,6,1,9
  18. };
  19. matrix m4x4A={4,4,&b4x4A[0][0]};
  20. */
  21.  
  22. /* Function prototypes */
  23. void mprint(matrixptr);
  24. void smmult(matrixptr,double);
  25. int madd(matrixptr m1,matrixptr m2,matrixptr dm);
  26. int mmult(matrixptr m1,matrixptr m2,matrixptr dm);
  27. int mcopy(matrixptr sm,matrixptr dm);
  28. int mtrans(matrixptr sm,matrixptr dm);
  29. double det(matrixptr m);
  30. int minv(matrixptr sm,matrixptr dm);
  31. int nsolve(int rows,double *data);
  32. int mid(matrixptr);
  33. void mzero(matrixptr);
  34. #endif
  35.  
  36.